//
//  ZWLRecommandCollectionViewCell.m
//  ZWLMusic
//
//  Created by dllo on 16/1/6.
//  Copyright © 2016年 ZKJ. All rights reserved.
//

#import "ZWLRecommandCollectionViewCell.h"

@implementation ZWLRecommandCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
        [self getData];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    self.tableView.frame = CGRectMake(0, 0, self.width, self.height);
    self.headView.frame = CGRectMake(0, 0, self.width, 200 * ptsHEIGTH);
    self.Carousel.frame = CGRectMake(0, 0, self.headView.width, self.headView.height / 2);
}

- (void)getData {
    [ZKJNetWorkTool getWithUrl:kRecommandUrl parameter:nil httpHeader:nil responseType:ResponseTypeJSON success:^(id result) {
        
    } fail:^(NSError *error) {
        
    }];
}

- (void)createCell {
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self addSubview:self.tableView];
    
    self.headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 200 * ptsHEIGTH)];
    self.Carousel = [[ZKJScrollCollection alloc] initWithFrame:CGRectMake(0, 0, self.headView.width, self.headView.height / 2)];
    [self.headView addSubview:self.Carousel];
    
    self.tableView.tableHeaderView = self.headView;
    
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}

@end
